<template>
  <div class="wf hf y jc" v-if="show">
    <top />
    <router-view />
  </div>
</template>

<script>
import top from "../components/top";
export default {
  components: { top },
  data() {
    return {
      gd: {},
      show: false
    };
  },
  created() {
    this.$post(
      { cmd: 1005, val: { token: sessionStorage.token } },
      res => {
        this.$gd = res;
        this.$formatGD(this.$gd);
        // console.log(this.$cp(this.$gd.project));
        this.show = true;
        // this.handleSelect("itemType");
      },
      false,
      true
    );
  },
  methods: {
    handleSelect(key) {
      let path = "/admin/" + key;
      if (key == "exit") path = "/login";
      sessionStorage.setItem("page", key);
      if (this.$route.path != path) this.$router.push(path);
    }
  }
};
</script>

